package javacafe.action.admin;

import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javacafe.action.Action;
import javacafe.action.ActionForward;
import javacafe.dto.member.MemberDTO;
import javacafe.serviceimple.MemberServiceImple;


public class CustSearchAction implements Action {

	@Override
	public ActionForward execute(HttpServletRequest request,
			HttpServletResponse response) {

		if (request.getSession().getAttribute("") != null) {
			
		}
		ActionForward actfoward = new ActionForward();
		MemberServiceImple service = MemberServiceImple.getInstance();
		
		String id = request.getParameter("m_id");
		String name = request.getParameter("m_name");
		String auth = request.getParameter("auth_name");
		
		MemberDTO dto = new MemberDTO();
		if (id != null) {
			dto.setM_id(id);
		}
		if (name != null) {
			dto.setM_name(name);
		}
		if (auth != null) {
			dto.setAuth_name(auth);
		}
		
		List<MemberDTO> list = service.getSerchMember(dto);
		
		request.setAttribute("list", list);
		
		actfoward.setUrl("custmgrsearch");

		return actfoward;
	}
}
